
export const push = (url, params, ext) => {
  if (!url) {
    console.log('url is null.');
    return;
  }
  let path = wx.$base.urlMapping(url)
  if (!path) {
    console.error('url not exists.');
    return;
  }
  let urlPath = wx.$base.objToUrl(params)
  if (urlPath) {
    path = path + '?' + urlPath;
  }
  console.log('navigateTo', path);
  wx.navigateTo({
    url: '/' + path,
  })
}

export const pop = () => {
  wx.navigateBack()
}

export const toLogin = () => {
  wx.navigateTo({
    url: '/pages/user/login',
  })
}